<?php
class Mobile_GameController extends  Zend_Controller_Action{
	public function init(){
		parent::init();
	}
	public function  likeAction(){
		$this->_helper->layout()->disableLayout();
		$ns = new Zend_Session_Namespace("liked");
		if(isset($ns->liked)){
			echo "liked";
			return;
		} 
		if($this->_request->isPost()){
			$gameId = $this->_request->getPost('gameId');
			if($gameId){
				$ns->liked = "1";
				$mode_game = new Model_Game();
				$returnVal = $mode_game->addLike($gameId);
			}
		}
	}
	public function  shareAction(){
		$this->_helper->viewRenderer->setNoRender(true);
		if($this->_request->isPost()){
			$gameId = $this->_request->getPost('gameId');
			if($gameId){
				$mode_game = new Model_Game();
				$returnVal = $mode_game->addShare($gameId);
			}
		}
	}
	public function adddownloadAction(){
		$this->_helper->viewRenderer->setNoRender(true);
		if($this->_request->isPost()){
			$gameId = $this->_request->getPost('gameId');
			if($gameId){
				$mode_game = new Model_Game();
				$returnVal = $mode_game->addDownload($gameId);
			}
		}
	}
}